package com.zzptc.zzsgz.bdsjws.fragments.base;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/5/26 0026.
 */

public abstract class BaseFragmentbase extends Fragment {
    Unbinder unbinder;
    private View view;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(getXML() , container , false);
        unbinder = ButterKnife.bind(this , view);
        initView();
        initDate();
        return view;

    }

    public abstract int getXML();

    public abstract void initView();

    public abstract void initDate();

    @Override
    public void onDestroyView() {
        if (unbinder != null){
            unbinder.unbind();
        }
        super.onDestroyView();

    }
}
